package com.mdd.front.validate.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@ApiModel("短信发送参数")
public class SmsEmailValidate implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "scene参数缺失")
    @ApiModelProperty(value = "场景码")
    private String scene;

    @NotNull(message = "邮箱参数缺失")
    @NotEmpty(message = "邮箱不能为空")
    @Pattern(regexp = "^\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}$", message = "邮箱格式有误")
    @ApiModelProperty(value = "邮箱")
    private String email;

}
